<template>
  <div id="home">
    <view class="pageBx" v-for="(item, index) in pages" :key="index" @click="toPage(index)">
      <view class="pageUrl">{{ item.path }}</view>
      <view class="pageNmae">{{index+1}}、{{ item.style.navigationBarTitleText }}</view>
    </view>
  </div>
</template>
<script>
  export default {
    name: 'Home',
    data() {
      return {
        pages: [{
    "path": "pages/user/orderInfo/orderInfo",
    "style": {
      "navigationBarTitleText": "订单详情",
      "enablePullDownRefresh": false,
      "navigationStyle": "custom"
    }
  }, 
  {
    "path": "pages/user/order/order",
    "style": {
      "navigationBarTitleText": "我的订单",
      "navigationStyle": "custom",
      "enablePullDownRefresh": false
    }
  }]
      };
    },
    methods: {
      toPage(eq) {
        let data = this.pages[eq];
        if (
          data.path.includes('center/center') ||
          data.path.includes('index/index') ||
          data.path.includes('goods/classMenu/classMenu') ||
          data.path.includes('user/shopCar/shopCar')
        ) {
          uni.switchTab({
            url: '/' + data.path
          });
          return;
        }
        uni.navigateTo({
          url: '/' + data.path
        });
      }
    }
  };
</script>

<style scoped>
  #home {
    margin-top: 30rpx;
    margin-bottom: 300rpx;
  }

  .pageBx {
    padding: 30rpx 46rpx;
    box-shadow: 4rpx 11rpx 30rpx 3rpx rgba(0, 0, 0, 0.1);
    margin-bottom: 30rpx;
  }

  .pageUrl {
    font-size: 28rpx;
    margin-bottom: 10rpx;
    color: #606266;
  }

  .pageNmae {
    font-size: 26rpx;
    color: #000000;
  }
</style>
